package com.yeban.base.day04.homework;

import java.util.Arrays;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/9/28
 */

//需求3：把一个数组元素逆序交换，int[] a ={5,11,15,24,36,47,59,66}; 交换元素后int[] a = {66,59,47,36,24,15,11,5}
public class Test03 {

    public static void main(String[] args) {

        int[] a ={5, 11, 15, 24, 36, 47, 59, 66};

        int len = a.length;
        for (int i = 0; i < len >> 1; i++) {
            int temp = a[i];
            a[i] = a[len - 1 - i];
            a[len - 1 - i] = temp;
        }

        System.out.println(Arrays.toString(a));


    }
}
